<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@page import="java.util.*" %>

<% Map<String, Set<String>> valRules = (Map<String, Set<String>>)request.getAttribute("ValidationRules"); %>

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Register project</title>
	
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/content/common.css" />
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/content/bootstrap.css" />
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/content/projectregister.css" />	

	<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/lib/jQuery/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/lib/Moment/moment.js"></script>
	<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/regformvalidation.js"></script>
	<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/pages/project/registerPage.js"></script>
	<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/pages/project/registerPageActivator.js"></script>
	<script type="text/javascript" src="<%= request.getContextPath() %>/scripts/regformvalidation.js"></script>
</head>
<body>
	<h1>Registering New Project</h1>
	<div id="wrap">
		<div class="container-narrow">
			<div>
				<h2>Make your Step-Up</h2>
				<!-- project form -->
				<!-- TODO: Set action -->
				 <form:form commandName="PROJECT" id="regprojectForm">
					
					<div class="row">
						<div class="span2 formlabelbox">
							<span class="labeltext">Project Name</span>
						</div>
						<div class="span3 forminputbox">
							<form:input path="Name" id="projectname" placeholder="Project Name" required="required" />
						</div>
						<div class="span2 formtipbox">
							<span class="error_tooltip">
								<% if(valRules != null && valRules.get("projectname") != null) 
								 { 
										 for(String msgs : valRules.get("projectname"))  { 
											out.println(msgs);
										}  
								 } %>
							</span>
						</div>
					</div>	

					<div class="row">
						<div class="span2 formlabelbox">
							<span class="labeltext">Project Description</span>
						</div>
						<div class="span3 forminputbox">
							<form:textarea path="description" id="projectdescription" placeholder="Project Description" required="required" />
						</div>
						<div class="span2 formtipbox">
							<span class="error_tooltip">
								<% if(valRules != null && valRules.get("projectdescription") != null) 
								 { 
										 for(String msgs : valRules.get("projectdescription"))  { 
											out.println(msgs);
										} 
								 } %>
							</span>
						</div>
					</div>	
	
					<div class="row">
						<div class= "span2 formlabelbox">
							<span class="labeltext">Goal</span>
						</div>
						<div class= "span3 forminputbox">
							<form:textarea path="goal" 
							 id="goal" placeholder="Project Goal Description" required="required" />
						</div>
						<div class= "span2 formtipbox">
							<span class="error_tooltip">
								<% if(valRules != null) 
								 { 
									 if(valRules.get("goal") != null) { 
											 for(String msgs : valRules.get("goal"))  { 
												out.println(msgs);
											} 
									 } 
								 } %>
							</span>
						</div>
					</div>	
	
					<div class="row">
						<div class= "span2 formlabelbox">
							<span class="labeltext">Project Mission</span>
						</div>
						<div class= "span3 forminputbox">
							<form:textarea path="mission" id="projectmission" placeholder="Project Mission" required="required" />
						</div>
						<div class= "span2 formtipbox">
							<span class="error_tooltip">
								<% if(valRules != null) 
								 { 
									 if(valRules.get("projectmission") != null) { 
											 for(String msgs : valRules.get("projectmission"))  { 
												out.println(msgs);
											} 
									 } 
								 } %>
							</span>
						</div>
					</div>	
	
					<div class="row">
						<div class= "span2 formlabelbox">
							<span class="labeltext">Photo</span>
						</div>
						<div class= "span3 forminputbox">
							<input type="file" id="projectphoto"  name="photo" required="required" />
						</div>
						<div class= "span2 formtipbox">
							<span class="error_tooltip">
								<% if(valRules != null) 
								 { 
									 if(valRules.get("projectphoto") != null) { 
											 for(String msgs : valRules.get("projectphoto"))  { 
												out.println(msgs);
											} 
									 } 
								 } %>
							</span>
						</div>
					</div>	
	
					<div class="row">
						<div class= "span2 formlabelbox">
							<span class="labeltext">Video link</span>
						</div>
						<div class= "span3 forminputbox">
							<form:input path="videoLink" id="videolink" placeholder="Video link ex.: http://youtube.com/bla-bla-bla" required="required" />						
						</div>
						<div class= "span2 formtipbox">
							<span class="error_tooltip">
								<% if(valRules != null) 
								 { 
									 if(valRules.get("videolink") != null) { 
											 for(String msgs : valRules.get("videolink"))  { 
												out.println(msgs);
											} 
									 } 
								 } %>
							</span>
						</div>
					</div>

					<div class="row">
						<div class= "span2 formlabelbox">
							<span class="labeltext">Expected budget</span>
						</div>
						<div class= "span3 forminputbox">
							<form:input type="number" path="expectedBudget" id="budget"  placeholder="10.00" min="10.0" required="required" />
						</div>
						<div class= "span2 formtipbox">
							<span class="error_tooltip">
								<% if(valRules != null) 
								 { 
									 if(valRules.get("budget") != null) { 
											 for(String msgs : valRules.get("budget"))  { 
												out.println(msgs);
											} 
									 } 
								 } %>
							</span>
						</div>
					</div>	
	
					<div class="row">
						<div class= "span2 formlabelbox">
							<span class="labeltext">Expiration Date</span>
						</div>
						<div class= "span3 forminputbox">
							<form:input type="date" path="expireDate" id="expirationdate" required="required" />						
						</div>
						<div class= "span2 formtipbox">
							<span class="error_tooltip">
								<% if(valRules != null) 
								 { 
									 if(valRules.get("expirationdate") != null) { 
											 for(String msgs : valRules.get("expirationdate"))  { 
												out.println(msgs);
											} 
									 } 
								 } %>
							</span>
						</div>
					</div>	
	

					<div class="row">
						<div class= "span2 formlabelbox">
							<span class="labeltext"></span>
						</div>
						<div class= "span3 forminputbox">
							<input type="submit" class="button-warning" value="Step-Up Project!" />									
						</div>
						<div class= "span2 formtipbox">
							<span class="error_tooltip"></span>
						</div>
					</div>	

				</form:form>
			</div>
		</div>	
	</div>
	<input type="hidden" id="uniqproj" value="0"/>
</body>
</html>